package com.caul.demo.hadoop.rpc.client;

import com.caul.demo.hadoop.rpc.server.LoginService;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * Created by sdliang on 2018/3/30.
 */
public class ClientDemo {

  public static void main(String[] args) throws IOException {
    InetSocketAddress addr = new InetSocketAddress("localhost", 10000);
    Configuration conf = new Configuration();
    LoginService proxy = RPC.getProxy(LoginService.class, LoginService.versionID, addr, conf);
    String value = proxy.login("sdl", "123456");
    System.out.println(value);
  }

}
